<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head><meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>AsciiConverterTest xref</title>
<link type="text/css" rel="stylesheet" href="../../../stylesheet.css" />
</head>
<body>
<div id="overview"><a href="../../../../testapidocs/de/aikiit/spamprotector/AsciiConverterTest.html">View Javadoc</a></div><pre>
<a class="jxr_linenumber" name="L1" href="#L1">1</a>   <em class="jxr_javadoccomment">/**</em>
<a class="jxr_linenumber" name="L2" href="#L2">2</a>   <em class="jxr_javadoccomment"> SpamSchutz - simple way to protect your mail adresses from naiive spammers</em>
<a class="jxr_linenumber" name="L3" href="#L3">3</a>   <em class="jxr_javadoccomment"> Copyright (C) 2011, Aiki IT</em>
<a class="jxr_linenumber" name="L4" href="#L4">4</a>   
<a class="jxr_linenumber" name="L5" href="#L5">5</a>   <em class="jxr_javadoccomment"> This program is free software: you can redistribute it and/or modify</em>
<a class="jxr_linenumber" name="L6" href="#L6">6</a>   <em class="jxr_javadoccomment"> it under the terms of the GNU General Public License as published by</em>
<a class="jxr_linenumber" name="L7" href="#L7">7</a>   <em class="jxr_javadoccomment"> the Free Software Foundation, either version 3 of the License, or</em>
<a class="jxr_linenumber" name="L8" href="#L8">8</a>   <em class="jxr_javadoccomment"> (at your option) any later version.</em>
<a class="jxr_linenumber" name="L9" href="#L9">9</a>   
<a class="jxr_linenumber" name="L10" href="#L10">10</a>  <em class="jxr_javadoccomment"> This program is distributed in the hope that it will be useful,</em>
<a class="jxr_linenumber" name="L11" href="#L11">11</a>  <em class="jxr_javadoccomment"> but WITHOUT ANY WARRANTY; without even the implied warranty of</em>
<a class="jxr_linenumber" name="L12" href="#L12">12</a>  <em class="jxr_javadoccomment"> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</em>
<a class="jxr_linenumber" name="L13" href="#L13">13</a>  <em class="jxr_javadoccomment"> GNU General Public License for more details.</em>
<a class="jxr_linenumber" name="L14" href="#L14">14</a>  
<a class="jxr_linenumber" name="L15" href="#L15">15</a>  <em class="jxr_javadoccomment"> You should have received a copy of the GNU General Public License</em>
<a class="jxr_linenumber" name="L16" href="#L16">16</a>  <em class="jxr_javadoccomment"> along with this program.  If not, see &lt;<a href="http://www.gnu.org/licenses/&gt;" target="alexandria_uri">http://www.gnu.org/licenses/&gt;</a>.</em>
<a class="jxr_linenumber" name="L17" href="#L17">17</a>  <em class="jxr_javadoccomment">*/</em>
<a class="jxr_linenumber" name="L18" href="#L18">18</a>  <strong class="jxr_keyword">package</strong> de.aikiit.spamprotector;
<a class="jxr_linenumber" name="L19" href="#L19">19</a>  
<a class="jxr_linenumber" name="L20" href="#L20">20</a>  <strong class="jxr_keyword">import</strong> org.junit.Test;
<a class="jxr_linenumber" name="L21" href="#L21">21</a>  
<a class="jxr_linenumber" name="L22" href="#L22">22</a>  <strong class="jxr_keyword">import</strong> <strong class="jxr_keyword">static</strong> org.junit.Assert.assertEquals;
<a class="jxr_linenumber" name="L23" href="#L23">23</a>  <strong class="jxr_keyword">import</strong> <strong class="jxr_keyword">static</strong> org.junit.Assert.assertNotNull;
<a class="jxr_linenumber" name="L24" href="#L24">24</a>  
<a class="jxr_linenumber" name="L25" href="#L25">25</a>  <em class="jxr_javadoccomment">/**</em>
<a class="jxr_linenumber" name="L26" href="#L26">26</a>  <em class="jxr_javadoccomment"> * Created by IntelliJ IDEA.</em>
<a class="jxr_linenumber" name="L27" href="#L27">27</a>  <em class="jxr_javadoccomment"> * User: hirsch</em>
<a class="jxr_linenumber" name="L28" href="#L28">28</a>  <em class="jxr_javadoccomment"> * Date: Apr 10, 2003</em>
<a class="jxr_linenumber" name="L29" href="#L29">29</a>  <em class="jxr_javadoccomment"> * Time: 1:20:02 PM</em>
<a class="jxr_linenumber" name="L30" href="#L30">30</a>  <em class="jxr_javadoccomment"> */</em>
<a class="jxr_linenumber" name="L31" href="#L31">31</a>  <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">class</strong> <a href="../../../de/aikiit/spamprotector/AsciiConverterTest.html">AsciiConverterTest</a> {
<a class="jxr_linenumber" name="L32" href="#L32">32</a>      @Test
<a class="jxr_linenumber" name="L33" href="#L33">33</a>      <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">void</strong> testConversionOnString() {
<a class="jxr_linenumber" name="L34" href="#L34">34</a>          AsciiConverter converter = <strong class="jxr_keyword">new</strong> AsciiConverter();
<a class="jxr_linenumber" name="L35" href="#L35">35</a>          String in = <span class="jxr_string">"mailto:woo@suck.er"</span>;
<a class="jxr_linenumber" name="L36" href="#L36">36</a>  
<a class="jxr_linenumber" name="L37" href="#L37">37</a>          String out = converter.replaceString(in);
<a class="jxr_linenumber" name="L38" href="#L38">38</a>          assertEquals(<span class="jxr_string">"&amp;#109;&amp;#97;&amp;#105;&amp;#108;&amp;#116;&amp;#111;&amp;#58;&amp;#119;&amp;#111;"</span> +
<a class="jxr_linenumber" name="L39" href="#L39">39</a>                  <span class="jxr_string">"&amp;#111;&amp;#64;&amp;#115;&amp;#117;&amp;#99;&amp;#107;&amp;#46;&amp;#101;&amp;#114;"</span>, out);
<a class="jxr_linenumber" name="L40" href="#L40">40</a>      }   <em class="jxr_comment">// end of main</em>
<a class="jxr_linenumber" name="L41" href="#L41">41</a>  
<a class="jxr_linenumber" name="L42" href="#L42">42</a>      @Test
<a class="jxr_linenumber" name="L43" href="#L43">43</a>      <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">void</strong> testConversionOnSingleCharacter() {
<a class="jxr_linenumber" name="L44" href="#L44">44</a>          AsciiConverter converter = <strong class="jxr_keyword">new</strong> AsciiConverter();
<a class="jxr_linenumber" name="L45" href="#L45">45</a>          assertEquals(<span class="jxr_string">"&amp;#42;"</span>, converter.replaceString(<span class="jxr_string">"*"</span>));
<a class="jxr_linenumber" name="L46" href="#L46">46</a>          <em class="jxr_comment">// TODO insert encoding into conversion</em>
<a class="jxr_linenumber" name="L47" href="#L47">47</a>          <em class="jxr_comment">// TODO http://www.herongyang.com/Unicode/Encoding-Conversion-Enter-Unicode-Data-in-Java-Program.html</em>
<a class="jxr_linenumber" name="L48" href="#L48">48</a>          <em class="jxr_comment">// assertEquals("U+00A5", converter.replaceString("U+00A5"));</em>
<a class="jxr_linenumber" name="L49" href="#L49">49</a>      }
<a class="jxr_linenumber" name="L50" href="#L50">50</a>  
<a class="jxr_linenumber" name="L51" href="#L51">51</a>      @Test
<a class="jxr_linenumber" name="L52" href="#L52">52</a>      <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">final</strong> <strong class="jxr_keyword">void</strong> versionStringSetByMaven() {
<a class="jxr_linenumber" name="L53" href="#L53">53</a>          assertNotNull(de.aikiit.spamprotector.util.Version.VERSION);
<a class="jxr_linenumber" name="L54" href="#L54">54</a>      }
<a class="jxr_linenumber" name="L55" href="#L55">55</a>  
<a class="jxr_linenumber" name="L56" href="#L56">56</a>  
<a class="jxr_linenumber" name="L57" href="#L57">57</a>  } <em class="jxr_comment">// end of class</em>
</pre>
<hr/>
<div id="footer">Copyright &#169; 2014 <a href="http://www.aiki-it.de">Aiki IT</a>. All rights reserved.</div>
</body>
</html>
